package com.liberty.dasheen.admin.sys.controller;

import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.liberty.dasheen.admin.sys.service.UserService;
import com.liberty.dasheen.common.BaseController;
import com.liberty.dasheen.config.shiro.realm.ShiroDbRealm;
import com.liberty.dasheen.entity.SysUser;

@Controller
@RequestMapping("/admin/sys/user")
public class UserController extends BaseController {
	
	private static final Logger log = LoggerFactory.getLogger(ShiroDbRealm.class);
	
	@Autowired
	private UserService userService;

	@RequestMapping("/all")
	@ResponseBody
	public List<SysUser> listAll(@RequestBody String json) {
		try {
			List<SysUser> list = userService.listAll();
			return list;
		} catch (Exception e) {
			System.out.println("UserController | listAll | Exception:" + e);
			return null;
		}
	}
}
